package com.ddddddl.zhangben.logic;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Request {
	
	public int type;
	
	public RequestListener requestListener;
	
	public Map<String, Object> params;
	
	public Map<String, Object> datas;
	
	public Request(int type, RequestListener requestListener) {
		super();
		this.type = type;
		this.requestListener = requestListener;
		params = new HashMap<String, Object>();
		datas = new HashMap<String, Object>();
	}
	
	public void put(String key, Object value){
		params.put(key, value);
	}
	
	public Object get(String key) {
		return params.get(key);
	}
	
	public void putString(String key, String value){
		params.put(key, value);
	}
	
	public String getString(String key) {
		Object object = params.get(key);
		if (object instanceof String) {
			return (String) object;
		} else {
			return null;
		}
	}
	
	public void putResponseObject(String key, Object value){
		datas.put(key, value);
	}
	
	public Object getResponseObject(String key) {
		return datas.get(key);
	}
	
}
